//
//  NSDate+additions.m
//  DreamSoftReimburse
//
//  Created by ZJ on 17/4/22.
//  Copyright © 2017年 ZJ. All rights reserved.
//

#import "NSDate+additions.h"

@implementation NSDate (additions)

+ (NSInteger)returnMaxDateFormDate:(NSDate *)firstDate  lastFate:(NSDate *)lastFate{
    switch ([firstDate compare:lastFate]) {
        case NSOrderedAscending:
            return -1;
            break;
        case NSOrderedSame:
            return 0;
            break;
        case NSOrderedDescending:
            return 1;
            break;
        default:
            break;
    }
    return 0;
}

/**
 获取当前的日期
 日期格式为:yyyy-MM-dd HH-mm
 */
+ (NSString *)getCurrentDate
{
    // 设置 日期的格式
    NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
    [formatter setDateFormat:@"YYYY-MM-dd HH:mm:ss"];
    
    // 获取 当前系统时间
    NSString *dataTime = [formatter stringFromDate:[NSDate date]];
    return dataTime;
}



@end
